Skip to content

Change SHA256 byte counter from size_t to uint64_t#731

Merged
real-or-random merged 4 commits into
bitcoin-core:masterfrom
real-or-random:202003-sha-size_t
Mar 24, 2022
Merged

Change SHA256 byte counter from size_t to uint64_t#731
real-or-random merged 4 commits into
bitcoin-core:masterfrom
real-or-random:202003-sha-size_t

Conversation

@real-or-random
Copy link
Copy Markdown
Contributor

This avoids that the SHA256 implementation would produce wrong paddings
and thus wrong digests for messages of length >= 2^32 bytes on 32-bit
platforms.

This is not exploitable in any way since the SHA256 API is an internal
API and we never call it with that long messages.

This also simplifies the struct initializer for the padding.
Since missing elements are initialized with zeros, this change is
purely syntactical.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants